Skip to content

Conversation

@ElektroDuck
Copy link

@ElektroDuck ElektroDuck commented Jan 25, 2026

What does this change

  • Adds it_IT (Italian) localized passport provider implementing the electronic passport format (2 letters, 7 digits).
  • Adds the cie() method to the it_IT SSN provider to generate valid Italian Electronic Identity Card numbers (2 letters, 5 digits, 2 letters).
  • Adds corresponding unit tests for both providers in tests/providers/test_passport.py and tests/providers/test_ssn.py.

What was wrong

  1. Passports: It lacked the standard electronic format used in Italy since 2010.
  2. Identity Cards: It lacked the modern Electronic Identity Card (CIE) format, which is now the standard in Italy, separate from the fiscal code (SSN).

How this fixes it

  • Created a new Provider class for passport/it_IT with the format ??####### (2 uppercase letters + 7 digits).
  • Extended the ssn/it_IT provider with a cie() method using the format ??#####?? as per official government specifications.
  • Added type hints and documentation sources for both new features.
  • Ensured all code follows the Black code style and includes appropriate regex-based unit tests to verify output patterns.

Checklist

  • I have read the documentation about CONTRIBUTING
  • I have read the documentation about Coding style
  • I have verified code style manually using black and flake8, and confirmed all unit tests pass via pytest

AI disclosure

This Pull Request was drafted and prepared with assistance from the language model Gemini 3 Flash.

The AI tool was used for the following specific tasks:

  • Analyzing Repository Structure
  • Drafting Documentation: Assisting in the composition of the Pull Request description and ensuring all checklist requirements were met.
  • Code Suggestions: Providing suggestions regarding validation patterns (Regex) and type hint best practices.

Technical Accuracy:
I confirm that the code changes were implemented manually by me. The implementation describes a real and reproducible addition to the it_IT locale, based on the actual Faker source code and verified against official Italian government sources (Polizia di Stato and Ministero dell'Interno). This PR does not depend on 3rd party applications and follows the repository's security and coding best practices.

As this is my first contribution to such a large repository, I hope everything is in order! I'm open to any feedback or code review suggestions you might have, and I'm ready to modify the implementation to ensure it aligns perfectly with the repository's standards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant